package lol.clann.minecraft.springboot.plugin.bukkit.command.resolver.factory;

import lol.clann.minecraft.springboot.api.bukkit.command.resolver.CommandResolver;
import lol.clann.minecraft.springboot.api.bukkit.command.resolver.CommandResolverFactory;
import org.springframework.stereotype.Component;

/**
 *
 * @author pyz
 * @date 2019/5/6 9:29 PM
 */
@Component
public class StringCommandResolverFactory implements CommandResolverFactory {
    @Override
    public boolean canResolve(Class<?> type) {
        return String.class == type;
    }

    @Override
    public CommandResolver getResolver(Class<?> clazz) {
        return (sender, arg, type) -> arg;
    }
}
